package com.huatai.bpmn.controller;

import cn.hutool.json.JSONObject;
import com.huatai.bpmn.entity.InvestCapitalEntity;
import com.huatai.bpmn.entity.dto.InvestCapitalDto;
import com.huatai.common.api.R;
import com.huatai.common.entity.UserInfo;
import com.huatai.common.util.AuthUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import com.huatai.bpmn.service.InvestCapitalService;

import java.util.List;
import java.util.Map;


/**
 * 实施详情表格
 *
 * @author yxy
 * @email yuanxy999@126.com
 * @date 2024-07-19 10:41:47
 */
@RestController
@RequestMapping("investcapital")
@Api(tags = "实施详情表格",value = "实施详情表格")
public class InvestCapitalController {
    @Autowired
    private InvestCapitalService investCapitalService;

	@PostMapping("/getList/{flowId}")
	@ApiOperation(value = " 根据用户查询用户实施列表")
	public R getList(@PathVariable String flowId){
		Map<String, List<InvestCapitalEntity>> list =investCapitalService.getList(flowId);
		return R.data(list);
	}


	@GetMapping("/delete/{id}")
	@ApiOperation(value = "发起删除任务")
	public R delete(@PathVariable Long id){
		return R.data(investCapitalService.delete(id));
	}

	@PostMapping("/addOrUpd")
	@ApiOperation(value = "发起数据新增和修改")
	public R addOrUpd(@RequestBody InvestCapitalEntity investCapitalEntity){
		return R.data(investCapitalService.addOrUpd(investCapitalEntity));
	}

	@GetMapping("/detailById/{id}")
	@ApiOperation(value = "根据id查询数据")
	public R detailById(@PathVariable Long id){
		return R.data(investCapitalService.detailById(id));
	}


}
